package org.vectrics.common.util;


import org.apache.log4j.*;
import java.util.*;


public class DateSync  {
    private static Category log = Category.getInstance(DateSync.class);
    
    public static long offset = 0;

    public static Date getCurrentTime() {
        Date date = new Date();
        if (offset != 0)
            date.setTime(date.getTime() + offset);
        return(date);
    }
    
    public static void setCurrentTime(Date currentTime) {
        Date date = org.vectrics.common.util.DateSync.getCurrentTime();
        offset = currentTime.getTime() - date.getTime();
    }
}

